<?php
namespace Lib;
class Lib {
	public function __get($sClassName) {
		$sFile = LIB . '/' . $sClassName . '.class.php';
		if (is_file ( $sFile )) {
			require_once $sFile;
			$sClass = '\Lib\\' . $sClassName;
			if (class_exists ( $sClass )) {
				$oObj = new $sClass ();
				$this->__set ( $sClassName, $oObj );
				return $oObj;
			}
		}
		$sFile = LIB . '/' . $sClassName . '/' . $sClassName . '.class.php';
		if (is_file ( $sFile )) {
			require_once $sFile;
			$sClass = __NAMESPACE__ . '\\' . $sClassName . '\\' . $sClassName;
			if (class_exists ( $sClass )) {
				$oObj = new $sClass ();
				$this->__set ( $sClassName, $oObj );
				return $oObj;
			}
		}
		return false;
	}
	
	public function __set($sName, $sValue) {
		$this->$sName = $sValue;
	}
}